/**
 * @authors yanwl
 * @date 2014-09-03
 */
$(document).on('select_loaded',function(){
	/*价格计算*/
	$('.dropbox').find('li').on('click',function(){
		var $parent = $(this).parents('.dropbox').prev(),
			accountNum = 0,
			useYear = 0,
			baseUser = $('#baseUser').val(),
			basePrice = $('#basePrice').val();
		if($parent.hasClass('dropbox_user')){
			accountNum = $(this).attr('data-value');
			useYear = $('.dropbox_time').next().find('.dropbox_value').attr('data-value');
			if(useYear == -1) {
				useYear = 1;
			}
		}else if($parent.hasClass('dropbox_time')){
			accountNum = $('.dropbox_user').next().find('.dropbox_value').attr('data-value');
			useYear = $(this).attr('data-value');
			if(useYear == -1) {
				useYear = 1;
			}
		}
		var price = parseFloat(accountNum / baseUser * useYear * basePrice).toFixed(2);
    	$('#price').html(price);
	});
})


$(function(){
	/*下拉框样式*/
	$(".dropbox").dropBox({
	    width: 105,
	    height: 20,
	    selheight:100
	});
});



